﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using XamarinAndroidSample.DroidMVP.Util;
using XamarinAndroidSample.DroidMVP.Views;
using XamarinAndroidSample.Model;

namespace XamarinAndroidSample.DroidMVP.Presenters
{
    public class EmployeePresenter
    {
        private IEmployeeView employeeView;
        public EmployeePresenter(IEmployeeView view)
        {
            this.employeeView = view;
        }
        public async System.Threading.Tasks.Task GetEmployeeAsync(int id)
        {
            string url = ClientUtil.url+"employees/"+id;
            await ClientUtil.GetAsync<EmployeeModel>(url, null,
            (model)=>employeeView.GetEmployeeSuccess(model),
            (error)=>employeeView.GetEmployeeFail(error));
        }
    }
}